package org.makcro.sms.services.chat.web.server.services;

import java.text.MessageFormat;
import java.util.List;

import org.apache.log4j.Logger;
import org.makcro.sms.services.chat.web.client.services.message.BulkService;

public class BulkServiceFacade implements BulkService {

	/**
	 * Logger instance
	 */
	private Logger logger = Logger.getLogger( BulkServiceFacade.class );
	
	private org.makcro.sms.services.chat.base.business.BulkService bulkService;
	
	@Override
	public int sendBulk(String messageText, String signature, List<String> receivers) {
		int messagesSent = bulkService.sendBulk( messageText, signature, receivers );
		
		logger.info( MessageFormat.format( "[{0}] bulk messsages forwarded to bulk service", messagesSent ) );
		return messagesSent;
	}

	public void setBulkService(org.makcro.sms.services.chat.base.business.BulkService bulkService) {
		this.bulkService = bulkService;
	}
}
